#pragma once
#include <mutex>

class Scanner
{
public:
	Scanner(void);
	~Scanner(void);
	void Start();
	bool Stop();

private:
	// cancel the scanner
	bool _active;

	// minimap parameters
	static const int _minimapheight=248;
  static const int _minimapwidth=257;
  static const int _minimapstarty=1035;
  static const int _minimapstartx = 25;

	// resolution values
	int _screenx;
	int _screeny;

	// map wich contains the found objects
	int _currentMap[_minimapwidth][_minimapheight];
	// the old map for matching
	int _oldMap[_minimapwidth][_minimapheight];

	// mutex for threadsafe _cancel access
	std::mutex _mutex;

	// Gets the color values und stores them in the map
	void GetColorValues();
	
	// checks the map and beeps if something interesting happend
	void CheckMap();

	// clear _currentMap
	void ClearCurrentMap();

	// clear _oldMap
	void ClearOldMap();
};

